import qs from 'qs'
import request from '/@/utils/request';

/**
 * 获取验证码
 * @returns
 */
export function getCaptcha() {
  return request({
    url: 'kaptcha',
    method: 'get',
  });
}

/**
 * 用户名登录
 * @param data
 * @returns
 */
export function login(data: any) {
  return request({
    url: 'auth/login',
    method: 'post',
    data,
  });
}



/**
 * 获取验证码
 * @param mobile
 * @returns
 */
export function getSmsCode(mobile: string) {
  return request({
    url: 'auth/send-code',
    method: 'post',
    data: { mobile },
  });
}

/**
 * 获取用户信息
 * @returns
 */
export function getUserInfo() {
  return request({
    url: 'auth/user-info',
    method: 'get',
  });
}

/**
 * 退出登录
 * @returns
 */
export function logout() {
  return request({
    url: 'auth/logout',
    method: 'post',
  });
}
